<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box">
        <p><strong>ssss</strong><span>aaaaaaaa</span></p>
        <p><span>bbbbbbb</span></p>
        <p><span>ccccccc</span></p>
        <p><span>dddddddd</span></p>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script>
        // $('span').click(function (e) { 
        //     e.preventDefault();
        //     let index = $(this).index() // 1,0,0,0
        //     console.log(index)
        // });
        $('span').click(function (e) { 
            e.preventDefault();
            let index = $('span').index(this) // 0,1,2,3
            console.log(index)
        });
    </script>
</body>
</html>